package com.example.droideep.fragment.tabs;

import android.os.Bundle;
import android.support.v4.view.ViewPager;
import android.view.View;
import android.widget.Button;
import android.widget.Toast;

import com.example.droideep.R;
import com.example.droideep.common.activities.SimpleFragmentBase;

import butterknife.InjectView;
import butterknife.OnClick;

/**
 * @author bri
 * @date 15-6-10.
 */
public class TabsViewPagerFragment extends SimpleFragmentBase {

    @InjectView(R.id.id_view_pager)
    ViewPager mViewPager;

    @Override
    protected int getContentResId() {
        return R.layout.fragment_tabs_view_pager;
    }

    @Override
    public void onViewCreated(View view, Bundle savedInstanceState) {
        super.onViewCreated(view, savedInstanceState);

        mViewPager.setAdapter(new TabsAdapter(new String[]{"Tab1", "Tab2"}));
    }

    @OnClick(R.id.add_btn)
    public void getHeight() {
        Toast.makeText(getActivity(), "Height" + mViewPager.getHeight(), Toast.LENGTH_SHORT).show();
    }
}
